1. Technical Field
This invention relates to improving efficiency of program execution. More specifically, the invention relates to optimizing source code and verification of the suggested optimization.
2. Description of the Prior Art
A compiler is a computer program or set of programs that translates text written in a source language into a target language. The original sequence is usually called the source code and the output called object code. Commonly the output has a form suitable for processing by other programs, but it may also take the form of a human readable text file. The most common reason for wanting to translate source code is to create an executable program. The name “compiler” is primarily used for programs that translate source code from a high level language to a lower level language. A compiler is likely to perform many or all of the following operations: lexing, preprocessing, parsing, semantic analysis, code optimizations, and code generation.
It is known in the art to improve compiler performance by rewriting instructions in source code to replace a sequence of instructions. This technique is known in the art as optimization. When an optimization of a compiled code is applied, the meaning of the program must be maintained. The intention of combining instructions is to yield the same results with a fewer number of machine cycles, thereby improving execution efficiency.
There are two broad categories of optimization tools. The first category is a tool to apply changes to the source code that changes the meaning of the program, and the second category is a tool that rewrites source code without changing the meaning of a program. However, there are limitations associated with both the first and second category of tools in the prior art, including, limiting the quantity of specific candidates for modification as well as limiting a select category of source code instructions.
Therefore, there is a need for an optimization technique that modifies source code that is not limited to loop transformations. A technique that resolves the shortcomings of the prior art should improve performance by displaying the location of a suggested change in the source code together with candidates within the source code subject to modification.